package com.example.demo1122.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo1122.DTO.ConversationMapDTO;
import com.example.demo1122.entity.Conversation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ConversationMapper extends BaseMapper<Conversation> {

    int insert(Conversation conversation);

    boolean update(Conversation conversation);

    boolean isConversationIDExists(Integer conversationID);

    List<Conversation> selectAllByStudentID(String studentID);

    int getConversationNum(@Param("studentID") String studentID);

    List<Conversation> showHistory(Conversation conversation);

    List<Conversation> selectAllByClassID(Integer classID);

    List<Conversation> fuzzySelect(Conversation conversation);

    void addTitle(Integer conversationID, String title);

    List<Conversation> selectAllByChapterID(Integer classID, Integer chapterID, String studentID);

    List<ConversationMapDTO> getCourseConversationNum_interval(Integer courseID, Integer chapterID, Integer Interval);

    List<ConversationMapDTO> getCourseConversationNum_range(Integer courseID, Integer chapterID, LocalDateTime startSelectTime, LocalDateTime endSelectTime);

    List<ConversationMapDTO> getClassConversationNum_interval(Integer classID, Integer chapterID, Integer Interval);

    List<ConversationMapDTO> getClassConversationNum_range(Integer classID, Integer chapterID, LocalDateTime startSelectTime, LocalDateTime endSelectTime);

//    String getCourseNameByID(Integer conversationID);
}
